package main

import (
	//"fmt"
	"gorm.io/gorm"
	"gorm.io/driver/mysql"
	"sipserver/device"
)
  
//   type Product struct {
// 	gorm.Model
// 	Code  string
// 	Price uint
//   }
  
  func main() {
	db, err := gorm.Open(mysql.Open("root:Zanlong123@tcp(127.0.0.1:3306)/ginchat?charset=utf8mb4&parseTime=True&loc=Local"), &gorm.Config{})
	if err != nil {
	  panic("failed to connect database")
	}
  
	// Migrate the schema
	//db.AutoMigrate(&models.UserBasic{})
	//db.AutoMigrate(&models.Message{})
	//db.AutoMigrate(&models.Contact{})
	//db.AutoMigrate(&models.GroupBasic{})
	db.AutoMigrate(&device.DeviceBasic{})

  }